package com.gitee.swsk33.catserviceconsumer.config;

import com.gitee.swsk33.catserviceconsumer.rule.LoadBalanceRandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

@Configuration
@LoadBalancerClient(value = "cat-provider", configuration = LoadBalanceRandomRule.class)
public class LoadBalanceConfig {

	@Bean
	@LoadBalanced
	public WebClient.Builder loadBalancedWebClientBuilder() {
		return WebClient.builder();
	}

}